﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Master.Master" AutoEventWireup="true" CodeBehind="wFrmClienteLocal.aspx.cs" Inherits="Crosland.Automotriz.Web.wFrmClienteLocal" EnableEventValidation="false" %>

<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dx" %>
<%@ Register Assembly="GMaps" Namespace="Subgurim.Controles" TagPrefix="cc1" %>

<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxRoundPanel" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">

    <script type="text/javascript">
              function ShowCreateAccountWindow() {
                  pcCreateAccount.Show();

              }

                  function MostrarAlerta() {
                      popupErrores.Show();
                  }


              function editarLocal(id) {

                  var hf = document.getElementById('<%= hfCodigo.ClientID %>');
                  hf.value = id;
                  __doPostBack('<%= base.ObtenerIdUnico(btnEditar)%>', id);
              }

              function eliminarLocal(id) {
                  if (confirm('Está seguro de eliminar este local del mapa?')) {
                      var hf = document.getElementById('<%= hfCodigo.ClientID %>');
                      hf.value = id;
                      __doPostBack('<%= base.ObtenerIdUnico(btnEliminar)%>', id);
                  }
              }

 </script>


    <div class="main-header" style="width:100%;" __designer:mapid="5f1">
        <div class="main-titulo" style="text-align: left" __designer:mapid="5f2">
            Locales de
    <asp:Label runat="server" Font-Bold="True" Font-Size="16pt" ID="lblCliente" 
                style="font-size: 17px"></asp:Label>

                                    </div>
    </div>

    
    
    <div style="padding: 15px">

                <table width="100%">
                    <tr>
                        <td width="105px">
                            <dx:ASPxButton ID="btnNuevoLocal" runat="server" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                                Text="Nuevo" Width="100px" onclick="btnNuevoLocal_Click">
                                <Image Url="~/Images/bt_new_button.gif">
                                </Image>
                            </dx:ASPxButton>
                </td>
                        <td width="105px">
                            <dx:ASPxButton ID="btnEditar2" runat="server" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" onclick="btnEditar2_Click" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Editar" 
                                Width="100px">
                                <Image Url="~/Images/edit.gif">
                                </Image>
                            </dx:ASPxButton>
                </td>
                        <td width="105px">
                            <dx:ASPxButton ID="btnEliminar2" runat="server" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" onclick="btnEliminar2_Click" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Eliminar" 
                                Width="100px">
                                <Image Url="~/Images/delete.png">
                                </Image>
                            </dx:ASPxButton>
                        </td>
                        <td width="105">
                            <dx:ASPxButton ID="btnVerMapa" runat="server" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                    CssPostfix="Office2010Blue" 
                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Mapa" 
                    Width="100px" onclick="btnVerMapa_Click">
                                <Image Url="~/Images/google_maps.png">
                                </Image>
                </dx:ASPxButton>
                        </td>
                        <td width="155">
                            <dx:ASPxButton ID="btnSalir" runat="server" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" onclick="btnSalir_Click" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Salir" 
                                Width="100px">
                                <Image Url="~/Images/logout.png">
                                </Image>
                            </dx:ASPxButton>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="height: 9px">
                            </td>
                        <td style="height: 9px">
                            </td>
                        <td style="height: 9px">
                            </td>
                        <td style="height: 9px">
                            </td>
                        <td style="height: 9px">
                            &nbsp;</td>
                        <td style="height: 9px">
                            &nbsp;</td>
                    </tr>
                    </table>



                <dx:ASPxGridView ID="grdLocales" runat="server" AutoGenerateColumns="False" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                    CssPostfix="Office2010Blue" Width="100%" 
                KeyFieldName="ID_LOCAL" Caption="Listado de Locales" 
                    style="font-size: x-small">
                    <Columns>
                        <dx:GridViewDataTextColumn Caption="Establecimiento" FieldName="ESTABLECIMIENTO" 
                            VisibleIndex="1">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Dirección" FieldName="DIRECCION" 
                            VisibleIndex="2">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Departamento" FieldName="DEPARTAMENTO" 
                            VisibleIndex="4">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Provincia" FieldName="PROVINCIA" 
                            VisibleIndex="5">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Distrito" FieldName="DISTRITO" 
                            VisibleIndex="6">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Tiene Mapa" FieldName="TIENE_MAPA" 
                            VisibleIndex="9" Width="50px">
                            <DataItemTemplate>
                                <asp:LinkButton ID="lnkVerMapa" runat="server" Font-Names="Arial" 
                                    Font-Size="10px" ForeColor="Blue" Text='<%# Bind("TIENE_MAPA") %>' 
                                    onclick="lnkVerMapa_Click"></asp:LinkButton>
                            </DataItemTemplate>
                            <CellStyle HorizontalAlign="Center">
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="X" FieldName="NUM_COORDENADA_X" 
                            Visible="False" VisibleIndex="7">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Y" FieldName="NUM_COORDENADA_Y" 
                            Visible="False" VisibleIndex="8">
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <SettingsBehavior AllowSelectByRowClick="True" AllowFocusedRow="True" 
                        AllowDragDrop="False" AllowGroup="False" AllowSort="False" />

<SettingsBehavior AllowFocusedRow="True" AllowSelectByRowClick="True" 
                        AllowSelectSingleRowOnly="True"></SettingsBehavior>

                    <SettingsPager PageSize="20" Visible="False">
                    </SettingsPager>
                    <SettingsText GroupPanel="Arrastre una columna hasta aquí para agruparla por esa columna." />

<Settings ShowGroupButtons="False" ShowHeaderFilterBlankItems="False"></Settings>

<SettingsText GroupPanel="Arrastre una columna hasta aqu&#237; para agruparla por esa columna."></SettingsText>

                    <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                        <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanelOnStatusBar>
                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanel>
                    </Images>
                    <ImagesFilterControl>
                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanel>
                    </ImagesFilterControl>
                    <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                        CssPostfix="Office2010Blue">
                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                        </Header>
                        <DetailRow CssClass="dxgvDataRow_DevEx1">
                        </DetailRow>
                        <LoadingPanel ImageSpacing="5px">
                        </LoadingPanel>
                    </Styles>
                    <StylesPager>
                        <PageNumber ForeColor="#3E4846">
                        </PageNumber>
                        <Summary ForeColor="#1E395B">
                        </Summary>
                    </StylesPager>
                    <StylesEditors ButtonEditCellSpacing="0">
                        <ProgressBar Height="21px">
                        </ProgressBar>
                    </StylesEditors>
                </dx:ASPxGridView>
    </div> 




    <br />

                    <asp:Button ID="btnEditar" runat="server" 
        OnClick="btnEditar_postback" Text="Button" style="display: none"/>
                <asp:Button ID="btnEliminar"  runat="server" 
        OnClick="btnEliminar_postback" Text="Button" style="display: none"/>
                <asp:HiddenField ID="hfCodigo" runat="server" />   
          
              <dx:ASPxPopupControl ID="pcCreateAccount" runat="server" ClientInstanceName="pcCreateAccount" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                    CssPostfix="Office2010Blue" EnableViewState="False" 
                    HeaderText="Mapa de " 
                    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                    AllowDragging="True" CloseAction="CloseButton" Modal="True" 
              EnableHotTrack="False">
                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                    </LoadingPanelImage>
                    <HeaderStyle>
                    <Paddings PaddingLeft="7px" />
                    </HeaderStyle>
                    <LoadingPanelStyle ImageSpacing="5px">
                    </LoadingPanelStyle>
                    <ContentCollection>
<dx:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">



 <cc1:GMap ID="mapa" runat="server" Width="700px" Height="500px" />


   </dx:PopupControlContentControl>
</ContentCollection>
   </dx:ASPxPopupControl>
      

      <dx:ASPxPopupControl ID="PopupMapaIndividual" runat="server" ClientInstanceName="pcMapaIndividual" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                    CssPostfix="Office2010Blue" EnableViewState="False" 
                    HeaderText="Mapa" 
                    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                    AllowDragging="True" CloseAction="CloseButton" Modal="True" 
              EnableHotTrack="False">
                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                    </LoadingPanelImage>
                    <HeaderStyle>
                    <Paddings PaddingLeft="7px" />
                    </HeaderStyle>
                    <LoadingPanelStyle ImageSpacing="5px">
                    </LoadingPanelStyle>
                    <ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True">



 <cc1:GMap ID="mapa2" runat="server" Width="700px" Height="500px"/>


   </dx:PopupControlContentControl>
</ContentCollection>
   </dx:ASPxPopupControl>



   <dx:ASPxPopupControl ID="popupErrores" runat="server" AllowDragging="True" 
                    ClientInstanceName="popupErrores" CloseAction="CloseButton" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue" 
                    EnableViewState="False" HeaderText="Mensaje" Modal="True" 
                    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
              Width="300px" EnableHotTrack="False">
                
                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                    </LoadingPanelImage>
                    <HeaderStyle>
                    <Paddings PaddingLeft="7px" />
                    </HeaderStyle>
                
                    <LoadingPanelStyle ImageSpacing="5px">
                    </LoadingPanelStyle>
                
                 <ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server" SupportsDisabledAttribute="True">

    <br />
      <dx:ASPxPanel ID="ASPxPanel3" runat="server" DefaultButton="btCreate">
                    <PanelCollection>
                        <dx:PanelContent ID="PanelContent2" runat="server">
                        <table width="100%">
                        <tr>
                        <td align="center" valign="middle">
                        
                        
                        
                            <asp:Label ID="lblMensaje" runat="server"></asp:Label>
                            <br /> &nbsp;</td>
                        
                        </tr>
                        <tr>
                        <td align="center">
                        
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
                        
                            <dx:ASPxButton ID="ASPxButton6" runat="server" AutoPostBack="False" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Aceptar" 
                                Width="10px">
                                <ClientSideEvents Click="function(s, e) {
	popupErrores.Hide();
}" />
                                <Image Url="~/Images/ok.png">
                                </Image>
                            </dx:ASPxButton>
                        
                        </td>
                        
                        </tr>
                        
                        
                        </table>




                 </dx:PanelContent>
    </PanelCollection>
   </dx:ASPxPanel>
   </dx:PopupControlContentControl>
</ContentCollection>
                </dx:ASPxPopupControl>



    </asp:Content>
